# -*- coding: utf-8 -*-
#-----------------------------------------
# @Time       : 2020/2/24 10:11
# @Author     : dqz 
# @Email      : 1406990390@qq.com
# @File       : feishu.py
# @Software   : PyCharm
#-----------------------------------------

import requests
from config.settings import CONNECT_TIMEOUT

class FeiShu:
    def __init__(self,token):
        self.url=f"https://open.feishu.cn/open-apis/bot/hook/{token}"
        self.headers={"content-Type":"application/json;charset=UTF-8"}

    def send_text(self,title,text):
        textMsg = {
            "title": title,
            "text": text
        }
        try:
            requests.post(self.url,json=textMsg,headers=self.headers,timeout=CONNECT_TIMEOUT)
        except Exception as e:
            pass


#https://open.feishu.cn/open-apis/bot/hook/ad9b7463616d441d96c3e91c2e71186b
